package im.frape.core;

import im.frape.R;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ContactListAdapter extends ArrayAdapter {
	private Context context;

	public ContactListAdapter(Context context, int textViewResourceId, ArrayList<String> array) {
		super(context, textViewResourceId, array);
		// TODO Auto-generated constructor stub
		this.context = context;

	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View row;
		LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		if (null == convertView) {
			row = mInflater.inflate(R.layout.contact_item, null);
		} else {
			row = convertView;
		}

		TextView tv = (TextView) row.findViewById(R.layout.contact_item);
		tv.setText((CharSequence) getItem(position));

		return row;
	}

}
